<!-- 子组件 -->
<template>
	<div>
		<!-- prop -->
		<h3>{{message}}</h3>

		<!-- $ref -->
		<h3>{{msg}}</h3>

		<!-- $emit -->
		<h3>我是子组件！</h3>
	</div>
</template>

<script>
	export default {
	    name: 'Child',
		props: ['message'] , //声明一个自定义的属性
		data() {
	        return {
	            msg: ''
			}
		},
		methods: {
	        getMessage(m) {
	            this.msg = m
			}
		},
		mounted: function () {
			this.$emit('getMsg','我是父组件！')
        }
	}
</script>

<style>
</style>
